package com.example.tomatotodo;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

/**
 * 用户信息更新页面Activity，用于加载UpdateFragment
 */
public class UpdateActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_update); // 设置activity_update布局

        // 首次创建时加载UpdateFragment（避免旋转屏幕重复创建）
        if (savedInstanceState == null) {
            FragmentManager fragmentManager = getSupportFragmentManager();
            FragmentTransaction transaction = fragmentManager.beginTransaction();
            // 替换内容区域为UpdateFragment（与RegisterActivity逻辑一致）
            transaction.replace(android.R.id.content, new UpdateFragment());
            transaction.commit();
        }
    }
}